package com.cy.pojo;


import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.ibatis.type.Alias;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author cy
 */
@Api("新用户实体类")
@Data
@TableName(value = "sys_new_user")
public class Nuser implements Serializable {

    @ApiModelProperty("新用户id")
    @TableId(type = IdType.AUTO)
    private Integer id;

    @Version
    private Integer version;

    @ApiModelProperty("新用户姓名")
    @NotBlank(message = "用户名不能为空")
    @TableField(value = "new_name")
    private String newName;

    @ApiModelProperty("新用户年龄")
    @Pattern(regexp = "^(\\\\d|[1-9]\\\\d|100)$",message = "用户年龄不符合规格")
    @TableField(value = "new_age")
    private Integer newAge;

    @ApiModelProperty("新用户手机号")
    @Pattern(regexp = "^1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$",
              message = "用户手机号不符合规则")
    @TableField(value = "new_mobile")
    private String newMobile;

    @ApiModelProperty("新用户创建时间")
    private Date  createdTime;

    @ApiModelProperty("新用户修改时间")
    private Date modifiedTime;

    @TableField(value = "status")
    private Integer status;

    @TableField(exist = false)
    private List<Mapping> mappingList;

}
